package com.sixth.controller;

import com.sixth.entity.Staff;
import com.sixth.entity.Stafftransfer;
import com.sixth.service.StafftransferService;
import com.sixth.util.CommonResult;
import com.sixth.util.TableLayUi;
import com.sixth.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @program: project01
 * @description:
 * @author: 高振杨
 * @create: 2021-12-20 16:21
 **/
@RestController
@RequestMapping("/transferstaffstaff")
public class TransferstaffController {

    @Autowired
    private StafftransferService stafftransferService;

    //查询调动员工
    @RequestMapping("/geteditIngstaff")
    public CommonResult geteditIngstaff(Integer staffid){
        return  stafftransferService.geteditIngstaff(staffid);
    }
    //调动员工
    @RequestMapping("/editstaff")
    public CommonResult transferstaff(Integer staffid, Integer branchid, Integer deptid, Integer newbranchid, Integer newdeptid, Date applytime, Integer applyid, Integer state){
        return stafftransferService.transferstaff(staffid,branchid,deptid,newbranchid,newdeptid,applytime,applyid,state);
    }

    //员工审核查全部
    @RequestMapping("/getAll")
    public TableLayUi getll(int page, int limit, Integer branchid){
        return stafftransferService.findAll(page, limit, branchid);
    }
}
